package com.cblz.bd.server.core.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cblz.bd.common.core.entity.BaAdminGroup;
import com.cblz.bd.common.core.entity.system.AdminGroupTree;
import com.cblz.bd.common.core.entity.system.IndexSearchParams;
import com.cblz.bd.server.core.entity.vo.BaAdminGroupVO;
import com.cblz.bd.server.core.event.MenuRulesEditEventListen;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yanjieping
 * @description 针对表【ba_admin_group(管理分组表)】的数据库操作Service
 * @createDate 2022-11-04 15:09:53
 */
public interface BaAdminGroupService extends IService<BaAdminGroup> {
    /**
     * 根据登录ID拿到用户权限
     *
     * @param loginId
     * @return
     */
    List<BaAdminGroup> getBdAdminRulesByLoginId(Integer loginId);

    /**
     * 根据主键ID拿到分组的树形结构
     *
     * @return
     */
    List<AdminGroupTree> getAllGroupInfoTree(IndexSearchParams indexSearchParams);

    /**
     * 拿到所有分组的树形结构
     *
     * @return
     */
    List<AdminGroupTree> getAllGroupInfoTree(BaAdminGroup baAdminGroup);

    /**
     * 监听菜单权限的数据改动，再对角色组所拥有对应的权限进行相同改动
     */
    void menuRulesEditEvent(MenuRulesEditEventListen menuRulesEditEventListen);

    BaAdminGroup getGroupById(Integer id);

    void addOrUpdateGroup(BaAdminGroupVO baAdminGroupVO);

    HashMap<String, Object> checkDelete(Integer[] idsArray);

    Boolean checkHasName(Integer id, String name);
}
